<?php
use think\facade\Route;
Route::get('/','Index/index');

//生成产品管理路由
Route::group('products', function () {
    Route::get('/', 'Products/index');
    Route::post('/', 'Products/save');
    Route::put('/:id', 'Products/update');
    Route::delete('/:id', 'Products/delete');
});
// 产品分类路由
Route::group('api/categories', function () {
    Route::get('/', 'ProductCategories/index'); // 获取所有分类
    Route::post('/', 'ProductCategories/save'); // 创建分类
    Route::put('/:id', 'ProductCategories/update'); // 更新分类
    Route::delete('/:id', 'ProductCategories/delete'); // 删除分类
});
//单位管理
Route::group('api/units', function () {
    Route::get('/', 'ProductUnits/index');
    Route::post('/', 'ProductUnits/save');
    Route::put('/:id', 'ProductUnits/update');
    Route::delete('/:id', 'ProductUnits/delete');
});

//用户登录接口
Route::group('api/account',function(){
    Route::post('/login','Account/login');
    Route::post('/register','Account/register');
    Route::get('/captcha','Account/captcha');
});
//成员管理
Route::group('api/member',function(){
    Route::get('/', 'Member/index');
});

//文件上传
Route::post('api/uploader', 'Uploader/index');


Route::get('api/test', 'Index/test');

//项目管理
Route::group('api/project',function(){
    Route::get('/', 'Project/index');
    Route::post('/', 'Project/save');
    Route::put('/:id', 'Project/update');
    Route::delete('/:id', 'Project/delete');
});
//状态管理
Route::group('api/status',function(){
    Route::get('/', 'Status/index');
    Route::post('/', 'Status/save');
    Route::put('/:id', 'Status/update');
    Route::delete('/:id', 'Status/delete');
});
//企业管理

